const mongoose = require('mongoose');
const Schema = mongoose.Schema;

var date = new Date()
var mydate = date.toLocaleString("zh-CN")

// Create Schema
const PurchaseSchema = new Schema({
  operatorName: {
    type: String,
    required: true
  },
  describe: {
    type: String
  },

  expend: {
    type: Number,
    required: true
  },
  type: {
    type: String,
    default: '支出'
  },

  status: {
    type: String,
    require: true,
    default: '审核中'
    //默认1，通过审批2，完成采购3，不通过4
  },
  // remark: {
  //   type: String
  // },
  date: {
    type: String,
    default: mydate
  }
});

module.exports = Purchase = mongoose.model('purchase', PurchaseSchema);